package com.action.gulimall.order.service.feign;

import com.action.common.utils.R;
import com.action.gulimall.order.service.feign.FallBack.WareFeignServiceFallback;
import com.action.gulimall.order.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author sl shilun217@qq.com
 * @Deacription 远程调用库存服务
 * @date 2021/07/03/15:30
 **/
@FeignClient(value = "gulimall-ware",fallback = WareFeignServiceFallback.class)
public interface WareFeignService {
    @PostMapping(value = "/ware/waresku/hasStock")
    R skuIdHasStock(@RequestBody List<Long> skuIds);

    @PostMapping(value = "/ware/waresku/orderLockStock")
    R orderLockStock(@RequestBody WareSkuLockVo lockVo);

    @GetMapping("/ware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);
}
